<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
      <button @click="switchImage">切换图片</button>
        <!-- 1.绑定img的src属性 -->
        <img :src="showImgUrl" alt="">

        <!-- 2.绑定a的href属性 -->
        <a :href="href">百度一下</a>
    </div>

    <script src="./lib/Vue.js"></script>
    <script>
        const app = Vue.createApp({
            data() {
                return{
                  imgUrl1:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091107%2Ff4dcyhllltnf4dcyhllltn.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1661413021&t=c23a1bc197d77544c1181984c86344d5",
                  imgUrl2:"https://img2.baidu.com/it/u=1962453233,2247780240&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1658941200&t=c6e433bc9454c659e7c1aa6b232d74d2",
                  showImgUrl:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg9.51tietu.net%2Fpic%2F2019-091107%2Ff4dcyhllltnf4dcyhllltn.jpg&refer=http%3A%2F%2Fimg9.51tietu.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1661413021&t=c23a1bc197d77544c1181984c86344d5",
                  href:"http://www.baidu.com"
                }
            },
            methods: {
              switchImage() {
                this.showImgUrl = this.showImgUrl === this.imgUrl1 ? this.imgUrl2:this.imgUrl1
              }
            }
        })
        app.mount("#app")
    </script>
</body>
</html>